1 // not pure because parseJSON isn't pure 2 `{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo": "bar"}`); 3 `{"foo": "bar"}`.shouldBeSameJsonAs(`{"foo":"bar"}`); 4 `{"foo":"bar"}`.shouldBeSameJsonAs(`{"foo": "baz"}`).shouldThrow!UnitTestException; 5 try 6 `oops`.shouldBeSameJsonAs(`oops`); 7 catch (Exception e) 8 assert(e.msg == "Error parsing JSON: Unexpected character 'o'. (Line 1:1)");
If two strings represent the same JSON regardless of formatting